﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;

namespace Logic
{
    public class GiftCalculator
    {
        public double CalculateWeight(Gift gift, int count)
        {
            double totalWeight = 0;

            List<AbstractConfection> sweets = gift.Sweets;

            foreach (AbstractConfection sweet in sweets)
            {
                totalWeight += sweet.Weight * count;
            }

            return totalWeight;
        }
        public int CalculatePrice(Gift gift, int count)
        {
            int totalPrice = 0;

            List<AbstractConfection> sweets = gift.Sweets;

            foreach (AbstractConfection sweet in sweets)
            {
                totalPrice += sweet.Price * count;
            }

            return totalPrice;
        }
        public int CalculateCount(Gift gift, int count)
        {
            List<AbstractConfection> sweets = gift.Sweets;
            return (sweets.Count * count);
        }
    }
}
